<?php

require_once(sfConfig::get('sf_lib_dir').'/filter/base/BaseFormFilterPropel.class.php');

/**
 * Roditelj filter form base class.
 *
 * @package    dnevnik
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormFilterGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseRoditeljFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'skola_id'          => new sfWidgetFormPropelChoice(array('model' => 'Skola', 'add_empty' => true)),
      'ime_majka'         => new sfWidgetFormFilterInput(),
      'prezime_majka'     => new sfWidgetFormFilterInput(),
      'ime_staratelj'     => new sfWidgetFormFilterInput(),
      'prezime_staratelj' => new sfWidgetFormFilterInput(),
      'mobilni2'          => new sfWidgetFormFilterInput(),
      'clanarina'         => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'clanarina_tst'     => new sfWidgetFormFilterInput(),
      'clanarina_soc'     => new sfWidgetFormFilterInput(),
      'kredit'            => new sfWidgetFormFilterInput(),
      'oba_telefona'      => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'ocene'             => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'izostanci'         => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'domaci'            => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'obavestenja'       => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'otac_pok'          => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'majka_pok'         => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'tip'               => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'skola_id'          => new sfValidatorPropelChoice(array('required' => false, 'model' => 'Skola', 'column' => 'id')),
      'ime_majka'         => new sfValidatorPass(array('required' => false)),
      'prezime_majka'     => new sfValidatorPass(array('required' => false)),
      'ime_staratelj'     => new sfValidatorPass(array('required' => false)),
      'prezime_staratelj' => new sfValidatorPass(array('required' => false)),
      'mobilni2'          => new sfValidatorPass(array('required' => false)),
      'clanarina'         => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'clanarina_tst'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'clanarina_soc'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'kredit'            => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'oba_telefona'      => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'ocene'             => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'izostanci'         => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'domaci'            => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'obavestenja'       => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'otac_pok'          => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'majka_pok'         => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'tip'               => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('roditelj_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Roditelj';
  }

  public function getFields()
  {
    return array(
      'id'                => 'ForeignKey',
      'skola_id'          => 'ForeignKey',
      'ime_majka'         => 'Text',
      'prezime_majka'     => 'Text',
      'ime_staratelj'     => 'Text',
      'prezime_staratelj' => 'Text',
      'mobilni2'          => 'Text',
      'clanarina'         => 'Date',
      'clanarina_tst'     => 'Number',
      'clanarina_soc'     => 'Number',
      'kredit'            => 'Number',
      'oba_telefona'      => 'Boolean',
      'ocene'             => 'Boolean',
      'izostanci'         => 'Boolean',
      'domaci'            => 'Boolean',
      'obavestenja'       => 'Boolean',
      'otac_pok'          => 'Boolean',
      'majka_pok'         => 'Boolean',
      'tip'               => 'Number',
    );
  }
}
